
USE [RD_InventoryMart]
GO

TRUNCATE table dbo.Inventory_Star_Facts
go

TRUNCATE table dbo.Inventory_Star_FactsDetails
go

TRUNCATE table dbo.Inventory_Star_Location
go

TRUNCATE table dbo.Inventory_Star_Lot
go

TRUNCATE table dbo.Inventory_Star_TransactionType
go




/****** Object:  Index [IX_BUiD]    Script Date: 06/06/2011 08:57:29 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_Facts]') AND name = N'IX_BUiD')
DROP INDEX [IX_BUiD] ON [dbo].[Inventory_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_BusinessUnitID]    Script Date: 06/06/2011 08:57:29 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_Facts]') AND name = N'IX_Facts_BusinessUnitID')
DROP INDEX [IX_Facts_BusinessUnitID] ON [dbo].[Inventory_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_CompanyID]    Script Date: 06/06/2011 08:57:29 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_Facts]') AND name = N'IX_Facts_CompanyID')
DROP INDEX [IX_Facts_CompanyID] ON [dbo].[Inventory_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_CostID]    Script Date: 06/06/2011 08:57:29 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_Facts]') AND name = N'IX_Facts_CostID')
DROP INDEX [IX_Facts_CostID] ON [dbo].[Inventory_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_DateUpdated]    Script Date: 06/06/2011 08:57:29 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_Facts]') AND name = N'IX_Facts_DateUpdated')
DROP INDEX [IX_Facts_DateUpdated] ON [dbo].[Inventory_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_ItemBranchID]    Script Date: 06/06/2011 08:57:29 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_Facts]') AND name = N'IX_Facts_ItemBranchID')
DROP INDEX [IX_Facts_ItemBranchID] ON [dbo].[Inventory_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_ItemNumberID]    Script Date: 06/06/2011 08:57:29 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_Facts]') AND name = N'IX_Facts_ItemNumberID')
DROP INDEX [IX_Facts_ItemNumberID] ON [dbo].[Inventory_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_LastReceiptDate]    Script Date: 06/06/2011 08:57:29 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_Facts]') AND name = N'IX_Facts_LastReceiptDate')
DROP INDEX [IX_Facts_LastReceiptDate] ON [dbo].[Inventory_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_LocationID]    Script Date: 06/06/2011 08:57:29 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_Facts]') AND name = N'IX_Facts_LocationID')
DROP INDEX [IX_Facts_LocationID] ON [dbo].[Inventory_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_LotID]    Script Date: 06/06/2011 08:57:29 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_Facts]') AND name = N'IX_Facts_LotID')
DROP INDEX [IX_Facts_LotID] ON [dbo].[Inventory_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_NextCountDate]    Script Date: 06/06/2011 08:57:29 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_Facts]') AND name = N'IX_Facts_NextCountDate')
DROP INDEX [IX_Facts_NextCountDate] ON [dbo].[Inventory_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_Facts_PriceID]    Script Date: 06/06/2011 08:57:29 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_Facts]') AND name = N'IX_Facts_PriceID')
DROP INDEX [IX_Facts_PriceID] ON [dbo].[Inventory_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_103]    Script Date: 06/06/2011 08:57:29 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_Facts]') AND name = N'missing_index_103')
DROP INDEX [missing_index_103] ON [dbo].[Inventory_Star_Facts] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [PK_Inventory_Star_Facts]    Script Date: 06/06/2011 08:57:29 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_Facts]') AND name = N'PK_Inventory_Star_Facts')
ALTER TABLE [dbo].[Inventory_Star_Facts] DROP CONSTRAINT [PK_Inventory_Star_Facts]
GO


USE [RD_InventoryMart]
GO

/****** Object:  Index [IX_FactsDet_CompanyID]    Script Date: 06/06/2011 08:57:41 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_FactsDetails]') AND name = N'IX_FactsDet_CompanyID')
DROP INDEX [IX_FactsDet_CompanyID] ON [dbo].[Inventory_Star_FactsDetails] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_FactsDet_CreationDate]    Script Date: 06/06/2011 08:57:41 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_FactsDetails]') AND name = N'IX_FactsDet_CreationDate')
DROP INDEX [IX_FactsDet_CreationDate] ON [dbo].[Inventory_Star_FactsDetails] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_FactsDet_GLDate]    Script Date: 06/06/2011 08:57:41 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_FactsDetails]') AND name = N'IX_FactsDet_GLDate')
DROP INDEX [IX_FactsDet_GLDate] ON [dbo].[Inventory_Star_FactsDetails] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_FactsDet_TransDate]    Script Date: 06/06/2011 08:57:41 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_FactsDetails]') AND name = N'IX_FactsDet_TransDate')
DROP INDEX [IX_FactsDet_TransDate] ON [dbo].[Inventory_Star_FactsDetails] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_FactsDetails_BusinessUnitID]    Script Date: 06/06/2011 08:57:41 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_FactsDetails]') AND name = N'IX_FactsDetails_BusinessUnitID')
DROP INDEX [IX_FactsDetails_BusinessUnitID] ON [dbo].[Inventory_Star_FactsDetails] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_FactsDetails_CostID]    Script Date: 06/06/2011 08:57:41 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_FactsDetails]') AND name = N'IX_FactsDetails_CostID')
DROP INDEX [IX_FactsDetails_CostID] ON [dbo].[Inventory_Star_FactsDetails] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_FactsDetails_ItemBranchID]    Script Date: 06/06/2011 08:57:41 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_FactsDetails]') AND name = N'IX_FactsDetails_ItemBranchID')
DROP INDEX [IX_FactsDetails_ItemBranchID] ON [dbo].[Inventory_Star_FactsDetails] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_FactsDetails_ItemNumberID]    Script Date: 06/06/2011 08:57:41 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_FactsDetails]') AND name = N'IX_FactsDetails_ItemNumberID')
DROP INDEX [IX_FactsDetails_ItemNumberID] ON [dbo].[Inventory_Star_FactsDetails] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_FactsDetails_LocationID]    Script Date: 06/06/2011 08:57:41 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_FactsDetails]') AND name = N'IX_FactsDetails_LocationID')
DROP INDEX [IX_FactsDetails_LocationID] ON [dbo].[Inventory_Star_FactsDetails] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_FactsDetails_LotID]    Script Date: 06/06/2011 08:57:41 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_FactsDetails]') AND name = N'IX_FactsDetails_LotID')
DROP INDEX [IX_FactsDetails_LotID] ON [dbo].[Inventory_Star_FactsDetails] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_FactsDetails_PriceID]    Script Date: 06/06/2011 08:57:41 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_FactsDetails]') AND name = N'IX_FactsDetails_PriceID')
DROP INDEX [IX_FactsDetails_PriceID] ON [dbo].[Inventory_Star_FactsDetails] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [IX_FactsDetails_TypeID]    Script Date: 06/06/2011 08:57:41 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_FactsDetails]') AND name = N'IX_FactsDetails_TypeID')
DROP INDEX [IX_FactsDetails_TypeID] ON [dbo].[Inventory_Star_FactsDetails] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_125]    Script Date: 06/06/2011 08:57:41 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_FactsDetails]') AND name = N'missing_index_125')
DROP INDEX [missing_index_125] ON [dbo].[Inventory_Star_FactsDetails] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [missing_index_361]    Script Date: 06/06/2011 08:57:41 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_FactsDetails]') AND name = N'missing_index_361')
DROP INDEX [missing_index_361] ON [dbo].[Inventory_Star_FactsDetails] WITH ( ONLINE = OFF )
GO

/****** Object:  Index [PK_Inventory_Star_FactsDetails]    Script Date: 06/06/2011 08:57:41 ******/
IF  EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[Inventory_Star_FactsDetails]') AND name = N'PK_Inventory_Star_FactsDetails')
ALTER TABLE [dbo].[Inventory_Star_FactsDetails] DROP CONSTRAINT [PK_Inventory_Star_FactsDetails]
GO

